package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 支出明细
 * </p>
 *
 * @author ding
 * @since 2020-06-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_cost_record")
public class CostRecordDo extends Model<CostRecordDo> {

    private static final long serialVersionUID = 1L;

    /**
     * 单号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 业务类型 0出库订单 1 入库订单 2仓储费 3货运费 4清关费
     */
    @TableField("type")
    private Integer type;

    /**
     * 消费内容
     */
    @TableField("content")
    private String content;

    /**
     * 扣款账户
     */
    @TableField("account_type")
    private Integer accountType;

    /**
     * 消费前余额
     */
    @TableField("before_amount")
    private Double beforeAmount;

    /**
     * 余额
     */
    @TableField("after_amount")
    private Double afterAmount;

    /**
     * 消费金额
     */
    @TableField("cost_amount")
    private Double costAmount;

    /**
     * 公司id
     */
    @TableField("company_id")
    private String companyId;

    @TableField("shop_id")
    private Long shopId;

    /**
     * 0未入账 1已扣款
     */
    @TableField("status")
    private Integer status;

    @TableField("third_id")
    private String thirdId;

    /**
     * 消费时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    @TableField("pay_time")
    private Date payTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
